import React, { useEffect } from "react";

const Car = () => {
  return <div>购物车</div>;
};

// 高阶组件
export const withTime = (Comp) => {
  return () => {
    console.time(Comp.name);
    useEffect(() => {
      console.timeEnd(Comp.name);
    }, []);
    return <Comp />;
  };
};

export default withTime(Car);
